﻿	config.initpage = function(gridNode) {
		var grid = gridNode.page;
		
		grid.on('afteredit', function(e){
			var record = e.record;
			if (e.field == 'project_plan__start_date' || e.field == 'project_plan__end_date') {
				//计划开始日期
				var sd = record.get('project_plan__start_date');
				if (sd == null) return;
				//计划结束日期
				var ed = record.get('project_plan__end_date');
				if (ed == null) return;
				
				//计算工期
				var dd = parseInt(ed.getElapsed(sd) / 1000 / 60 / 60 / 24) + 1;
				
				record.set('project_plan__project_day', dd);

				record.set('project_plan__done_sdate', sd);
				record.set('project_plan__done_edate', ed);
				record.set('project_plan__done_day', dd);
			}
		});
	};